package com.cd.card.domain;

import com.cd.common.domain.BaseDomain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Data
@Table(name = "lqq_card_user",indexes = {
        @Index(name = "uni_card_user_id", columnList = "user_id"),
})
@NoArgsConstructor
@AllArgsConstructor
public class LqqCardUser extends BaseDomain {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "user_id", nullable = false)
    @Schema(title = "用户id")
    private Long userId;

    @Column(name = "all_draw_times", nullable = false)
    @Schema(title = "总抽卡次数")
    private Long allDrawTimes;

    //奖券个数
    @Column(name = "draw_ticket", nullable = false)
    @Schema(title = "奖券个数")
    private Long drawTicket;

    @Column(name = "small_guarantee", nullable = false)
    @Schema(title = "小保底情况")
    private int smallGuarantee;

    @Column(name = "big_guarantee", nullable = false)
    @Schema(title = "大保底情况")
    private int bigGuarantee;

    //限定池是否吃过小保底
    @Column(name = "big_guarantee_flag", nullable = false)
    @Schema(title = "限定池是否吃过小保底,仅限定池")
    private int bigGuaranteeFlag;

    @Column(name = "create_time", nullable = false)
    @Schema(title = "创建时间，加入抽卡的时间")
    private Date createTime;

    public LqqCardUser(Long userId) {
        this.userId = userId;
    }
}
